package com.itheima.mall.api.sms;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.itheima.mall.mapper.sms.CouponProductCategoryRelationMapper;
import com.itheima.mall.pojo.sms.CouponProductCategoryRelation;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@DubboService
public class CouponProductCategoryRelationApiImpl implements CouponProductCategoryRelationApi{
    @Autowired
    private CouponProductCategoryRelationMapper couponProductCategoryRelationMapper;

    @Override
    public List<CouponProductCategoryRelation> selectCoupon(Long id) {
        LambdaQueryWrapper<CouponProductCategoryRelation>wrapper=new LambdaQueryWrapper<>();
        wrapper.eq(id !=null,CouponProductCategoryRelation::getCouponId,id);
        List<CouponProductCategoryRelation> couponProductCategoryRelations = couponProductCategoryRelationMapper.selectList(wrapper);
        return couponProductCategoryRelations;
    }
}
